﻿<?php
session_start();

if (!isset($_SESSION['login']) && !$_SESSION['login'] == true) {
	header ("Location: index.php");
}

include("LangHeader.php");
include 'config.php';
mysqli_set_charset($con, 'utf8');

?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<link rel="stylesheet" type="text/css" href="style.css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="scripts/jquery.tablesorter.js"></script>

<title>Sales Makeover</title>

</head>

<body>
	<div class="bodyLeft" id="bodyLeft">
		<?php include("menu.html"); ?>
	</div>
	<div class="bodyRight" id="bodyRight">
		<div class="container_head">
			<?php include("header.html"); ?>
		</div>
		<div class="container" id="container">
			<div class="content">
		

					
    <p style='padding-bottom:30px;padding-right:50%;margin-right:-20px; margin-top:30px'><a href='createInnovation.php' ><img src="content\addButtonA.png" height="40" align="right"></a></p>
	<center>
	<div style='color:white; padding-bottom:30px;' class="tr" key="menu_Create">
	
	</div>
	</center>
				<?php
				$companyID = $_SESSION['companyID'];
				$userID = $_SESSION['userid'];

				$stmt = $con->prepare('SELECT Innovation.Name AS InnoName, Innovation.ID AS InnoID, Innovation.CustomerName FROM Innovation WHERE Innovation.OwnerID = ?');
				$stmt->bind_param('i', $userID);
				$stmt->execute();
				$result = $stmt->get_result();
				
				while($row = $result->fetch_assoc())
				{
					echo "<a href='showInnovation.php?ID=" . $row['InnoID'] . "'><div style='border-top: 1px solid #333333;'>";
						echo "<div style='color:white; margin-left:10px;display: inline-block;position:relative; '>";
						echo "<span style='display:inline-block; vertical-align:middle;line-height:30px;'>";
						echo "<b>" . $row['CustomerName'] . "</b>";
						echo "<br/>";
						echo $row['InnoName'];
						echo "</div>";
						echo "<div id='innovation_links' style='float:right;display:inline-block; vertical-align: middle;margin-top:15px; '>";
						echo "<img src='content/icons/icon_view_default.png' />";
						echo "</span>";
						echo "</div>";
					echo "</div></a>";
				}
				echo "<div style='border-top: 1px solid #333333;'></div>";
				
				mysqli_close($con);
				
				?>
			</div>
		</div>
	</div>
	<?php if(isset($_SESSION["Popup"])){ $message = $_SESSION['Popup']; echo "<script type='text/javascript'>alert(getText('$message'));</script>"; unset($_SESSION['Popup']);} ?>
</body>

</html>
